package com.ocom.payconfig.dao;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ocom.common.entity.card.EntityCardInfo;
import com.ocom.common.entity.card.EntityXfMealInfo;
import com.ocom.common.vo.payconfig.MealDetailBVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoXfMealInfo extends BaseMapper<EntityXfMealInfo> {

    @Select({"<script> \n",
            "select t.meal_no,m.meal_name from \n" +
                    "xf_meal_time t INNER JOIN xf_meal_info m on t.meal_no = m.meal_no and t.com_id = m.com_id \n" +
                    "where t.com_id =#{comId} and t.point_id = 0 and t.acc_type_id = 0 and t.begin_time &lt;&gt; t.end_time"+
                    "</script>"}
    )
    public List<EntityXfMealInfo> getMealConsumeReports(Long comId);

    @Select("select mi.com_id,mi.meal_no,mi.meal_name\n" +
            ",mt.id,mt.acc_type_id,mt.point_id,mt.cons_time_zone,mt.begin_time as startTime,mt.end_time,mt.advance_money,mt.before_hour,mt.allow_days,mt.allow_minute\n" +
            "  from  xf_meal_info mi \n" +
            "left join xf_meal_time mt on mi.com_id=mt.com_id and mi.meal_no=mt.meal_no  ${ew.customSqlSegment}")
    public List<MealDetailBVo> getMealDetailListB(@Param(Constants.WRAPPER) Wrapper wrapper);


}
